/**
 * 消息发送者类型
 */
export type MessageSender = 'user' | 'assistant';

/**
 * 消息状态
 */
export type MessageStatus = 'sending' | 'sent' | 'error';

/**
 * 附件类型
 */
export type AttachmentType = 'project' | 'chapter' | 'character';

/**
 * 附件模型
 */
export interface Attachment {
  id: string;
  type: AttachmentType;
  name: string;
  content: string;
  entityId: string; // 引用的实体ID
}

/**
 * 消息模型
 */
export interface Message {
  id: string;
  createdAt: string;
  updatedAt: string;
  conversationId: string;
  content: string;
  sender: MessageSender;
  status: MessageStatus;
  attachments: Attachment[];
}

/**
 * 对话模型
 */
export interface Conversation {
  id: string;
  createdAt: string;
  updatedAt: string;
  projectId: string;
  chapterId?: string;
  title: string;
  messages: Message[];
}

/**
 * AI提示模板
 */
export interface PromptTemplate {
  id: string;
  name: string;
  description: string;
  content: string;
  category: string;
}

/**
 * 创建消息参数
 */
export interface CreateMessageParams {
  conversationId: string;
  content: string;
  sender: MessageSender;
  attachments?: Attachment[];
}

/**
 * 创建对话参数
 */
export interface CreateConversationParams {
  projectId: string;
  chapterId?: string;
  title: string;
}

/**
 * AI请求参数
 */
export interface AIRequestParams {
  messages: {
    role: 'user' | 'assistant' | 'system';
    content: string;
    attachments?: Attachment[];
  }[];
  temperature?: number;
  maxTokens?: number;
  promptTemplate?: string;
} 